package com.example.vp.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AttentionMapper {
    @Insert("insert into attention ( fans_id, attention_id) VALUES(#{userId},#{id}) ")
    void attentionUser(long userId, Long id);
    @Select("select count(*) from attention where fans_id = #{id}")
    Long getfansNumByUserId(Long id);
    @Select("select count(*) from attention where attention_id = #{id}")
    Long getattentionNum(Long id);
    @Select("select attention_id from attention where fans_id = #{userId}")
    List<Long> getAttentionByUserId(Long userId);
}
